package cn.jltx.abslistviewadapterdemo;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import cn.jltx.abslistviewadapterdemo.ExpandableBase.ExpandableViewActivity;
import cn.jltx.abslistviewadapterdemo.ExpandableEdit.ExpandableViewEditActivity;

public class MainActivity extends AppCompatActivity implements View.OnClickListener{
    private Button expandableListBtn;
    private Button expandableListEditBtn;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        expandableListBtn = (Button)this.findViewById(R.id.expandablelistview_btn);
        expandableListEditBtn = (Button)this.findViewById(R.id.expandablelistview_edit_btn);
        expandableListBtn.setOnClickListener(this);
        expandableListEditBtn.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        Intent intent = new Intent();
        switch (v.getId()){
            case R.id.expandablelistview_btn:
                intent.setClass(this, ExpandableViewActivity.class);
                startActivity(intent);
                break;
            case R.id.expandablelistview_edit_btn:
                intent.setClass(this, ExpandableViewEditActivity.class);
                startActivity(intent);
                break;
            default:
                break;
        }
    }
}
